﻿// ===============================================================================
// XCI.NET 西安交通信息WinForm开发框架 2018 版权所有
// ===============================================================================
using System;

namespace XCI.Data.Entity
{
    /// <summary>
    /// 列字段
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class ColumnAttribute : Attribute
    {
        /// <summary>
        /// 列字段
        /// </summary>
        public ColumnAttribute()
        {
        }

        /// <summary>
        /// 列字段
        /// </summary>
        /// <param name="caption">描述</param>
        public ColumnAttribute(string caption)
        {
            Caption = caption;
        }

        /// <summary>
        /// 列字段
        /// </summary>
        /// <param name="caption">描述</param>
        /// <param name="visable">是否可见</param>
        public ColumnAttribute(string caption,bool visable)
        {
            Caption = caption;
            Visable = visable;
        }

        /// <summary>
        /// 属性名称
        /// </summary>
        public string Name { get; internal set; }

        /// <summary>
        /// 列名
        /// </summary>
        public string DbName { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        public string Caption { get; set; }

        /// <summary>
        /// 导出
        /// </summary>
        public bool Export { get; set; } = true;

        /// <summary>
        /// 是否可见
        /// </summary>
        public bool Visable { get; set; } = true;
    }
}